<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/3/29
  Time: 16:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<html>
<head>
    <title>管理员登录页面</title>
    <link rel="stylesheet" href="css/login.css"/>
    <script src="js/login.js"></script>
    <style>
        .core_div{
            display: flex;
            flex-direction: row;
            align-items: center;
        }
        .core{
            width: 50px;
        }
        .core_img{
            margin-left: 20px;
            height: 40px;
            width: 60px;

        }
    </style>
    <script>
        function recode(img){
            img.src = "/code?=" + new Date().getTime();
        }
    </script>
</head>
<body>
    <div class="title_div">
        <h1>学生管理系统-管理页</h1>
        <c:if test="${param.status=='1'}">
            <span class="error">账号或密码错误</span>--%>
        </c:if>

        <c:if test="${param.status == '2'}">
            <span class="error">验证码错误</span>
        </c:if>
        <c:if test="${param.status == '3'}">
            <span class="error">验证码过期</span>
        </c:if>
<%--        <%--%>
<%--            String status =   request.getParameter("status");--%>
<%--            if ("1".equals(status)){--%>
<%--        %>--%>
<%--        <span class="error">账号或密码错误</span>--%>
<%--        <%--%>
<%--            }else if ("2".equals(status)){--%>
<%--         %>--%>
<%--         <span class="error">验证码错误</span>--%>
<%--        <%}else if ("3".equals(status)){%>--%>
<%--            <span class="error">验证码过期</span>--%>
<%--         <%--%>
<%--        }--%>

<%--        %>--%>
    </div>
    <div class="core_div">
        <form action="login" method="post">
            <table>
                <tr>
                    <td>用户名：</td>
                    <td><input name="username" placeholder="请输入用户"/></td>
                </tr>
                <tr>
                    <td>密码：</td>
                    <td><input type="password" name="password" placeholder="请输入密码"/></td>
                </tr>
                <tr>
                    <td>验证码：</td>
                    <td>
                        <div class="core_div">
                             <input  name="code" class="core"/>

                            <img class="core_img" src="/code" onclick="recode(this);" >
                        </div>
                    </td>

                </tr>

                <tr>
                    <td colspan="2" style="text-align: center">
                        <button type="submit">登录</button>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <button type="button" onclick="register();">注册</button>
                    </td>
                </tr>
            </table>

        </form>
    </div>
</body>
</html>
